package com.mycloud.core.dao;

import com.mycloud.core.model.Identifiable;
import org.hibernate.ObjectNotFoundException;

import java.util.List;
import java.util.Map;

/**
 * User: hossein bahramian
 * Date: Sep 27, 2011
 * Time: 3:50:20 PM
 */
public interface GenericDao {

    void persist(Identifiable object);

    <T> T get(Class<T> clazz, Long id) throws ObjectNotFoundException;

    void delete(Object object);

    Integer executeUpdate(String nativeQuery);

    Integer executeUpdate(String nativeQuery, Map<String, Object> params);

    List<Object[]> executeFind(String nativeQuery);

    <T> T readByName(Class<T> clazz, String name);

    <T> Long readIdByName(Class<T> clazz, String name);
}